Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 961ad0f6ca7f451c39ab19c3299db57ff007c9f6


Parents : 371fc61
Author : Sudo-Ivan <ivan@quad4.io>
Signature : Signature validation error
Date : 2026-01-03T19:40:31-06:00

feat(scripts): add OSV-Scanner script for vulnerability scanning and reporting

Changes

1 files changed, 38 insertions(+), 0 deletions(-)


Diff

diff --git a/scripts/osv_scan.sh b/scripts/osv_scan.sh
new file mode 100644
index 00000000..d62e1f07
--- /dev/null
+++ b/scripts/osv_scan.sh
@@ -0,0 +1,38 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+OSV_VERSION="${OSV_VERSION:-v2.3.1}"
+
+echo "Installing OSV-Scanner ${OSV_VERSION}..."
+curl -sSL "https://github.com/google/osv-scanner/releases/download/${OSV_VERSION}/osv-scanner_linux_amd64" -o /tmp/osv-scanner
+chmod +x /tmp/osv-scanner
+sudo mv /tmp/osv-scanner /usr/local/bin/osv-scanner
+
+echo "Running OSV-Scanner recursively..."
+OSV_JSON="$(mktemp)"
+trap 'rm -f "$OSV_JSON"' EXIT
+
+osv-scanner --recursive ./ --format json > "$OSV_JSON" || true
+
+if ! command -v jq >/dev/null 2>&1; then
+ echo "Error: jq is not installed. Please install jq to parse OSV results."
+ exit 1
+fi
+
+VULNS=$(jq -r '
+ .results[]? |
+ .source as $src |
+ .vulns[]? |
+ "\(.id) (source: \($src))"
+' "$OSV_JSON")
+
+if [ -n "$VULNS" ]; then
+ echo "OSV scan found vulnerabilities:"
+ echo "$VULNS" | while IFS= read -r line; do
+ echo " - $line"
+ done
+ exit 1
+else
+ echo "OSV scan: no vulnerabilities found."
+fi
+


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────